package com.hd.sup.modules.vehicle.model;

import java.io.Serializable;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hd.common.utils.GenUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * <p>
 * 车辆信息表
 * </p>
 *
 * @author chentl123
 * @since 2020-12-28
 */
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("sp_vehicle")
public class Vehicle extends Model<Vehicle> {

    private static final long serialVersionUID = 1L;

    //查询构造
    public Vehicle(String platNo, String vehicleType,String transType,String regionCode) {
        this.platNo = platNo;
        this.vehicleType = vehicleType;
        this.transType = transType;
        this.regionCode = regionCode;
    }

    //插入构造
    public Vehicle(String platNo, String enterpriseNo, String deptId, String enterpriseName, String vehicleType,  String transType, String platNoColor, String industryNo, String registration, String businessId, String owner, String ownerContact, String businessScope) {
        this.id = GenUtil.newId();
        this.platNo = platNo;
        this.enterpriseNo = enterpriseNo;
        this.deptId = deptId;
        this.enterpriseName = enterpriseName;
        this.vehicleType = vehicleType;
        this.transType = transType;
        this.platNoColor = platNoColor;
        this.industryNo = industryNo;
        this.registration = registration;
        this.businessId = businessId;
        this.owner = owner;
        this.ownerContact = ownerContact;
        this.businessScope = businessScope;
    }

    /**
     * 车辆编号
     */
    private String id;
    /**
     * 车牌号
     */
    @TableField("plat_no")
    private String platNo;
    /**
     * 企业id
     */
    @TableField("enterprise_no")
    private String enterpriseNo;
    /**
     * 企业名称
     */
    @TableField("enterprise_name")
    private String enterpriseName;
    /**
     * 车辆类型
     */
    @TableField("vehicle_type")
    private String vehicleType;
    /**
     * 运输类型
     */
    @TableField("trans_type")
    private String transType;
    /**
     * 车牌颜色
     */
    @TableField("plat_no_color")
    private String platNoColor;
    /**
     * 运输行业编号
     */
    @TableField("industry_no")
    private String industryNo;
    /**
     * 车籍地
     */
    private String registration;
    /**
     * 业务ID
     */
    @TableField("business_id")
    private String businessId;
    /**
     * 业户名称
     */
    private String owner;
    /**
     * 业户联系方式
     */
    @TableField("owner_contact")
    private String ownerContact;
    /**
     * 经营范围
     */
    @TableField("business_scope")
    private String businessScope;
    /**
     * 设备编号
     */
    @TableField("device_id")
    private String deviceId;
    /**
     * 创建人
     */
    @TableField("create_by")
    private String createBy;
    /**
     * 创建时间
     */
    @TableField("create_time")
    private Date createTime;
    /**
     * 更新时间
     */
    @TableField("update_time")
    private Date updateTime;
    /**
     * 更新人
     */
    @TableField("update_by")
    private String updateBy;
    /**
     * 组织机构id
     */
    @TableField("dept_id")
    private String deptId;

    @TableField(exist = false)
    private Integer limit;

    @TableField(exist = false)
    private String regionCode;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}
